package com.slz3.business.module.financeManagement.finReconciliationManage.service;

import com.slz3.business.frame.module.Repositorys;
import com.slz3.business.module.financeManagement.finReconciliationManage.domain.FinReconciliationManage;
import com.slz3.business.module.financeManagement.finReconciliationManage.domain.FinReconciliationManageFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Slf4j
@Service
public class FinReconciliationManageTransactionalServiceImpl implements FinReconciliationManageTransactionalService {

    @Override
    public FinReconciliationManage modify(FinReconciliationManage finReconciliationManageNew) {
        Repositorys.finReconciliationManage.test();
        Repositorys.finReconciliationManage.save(FinReconciliationManageFactory.initBaseFields());
        System.err.println(1 / 0);
        finReconciliationManageNew.setLastModifyTime(LocalDateTime.now());
        return Repositorys.finReconciliationManage.saveAndFlush(finReconciliationManageNew);
    }

    @Override
    public List<FinReconciliationManage> batchModify(List<FinReconciliationManage> finReconciliationManageList) {
        return Repositorys.finReconciliationManage.saveAll(finReconciliationManageList);
    }
}
